﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using CMS.BLL;


public partial class Controls_StaticPages_ctrStaticPageDetail : System.Web.UI.UserControl
{
    #region Constants

    int nCurentLanguage = Support.GetCurrentLanguage() - 1;

    #endregion
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            this.GetPage();
        }
    }

    private void GetPage()
    {
        try
        {
            int nPageID = 44; //ConvertData.ConvertToInt(Request.QueryString[Config.PAGE_ID]);
            StaticPages objStatic = new StaticPages();
            objStatic.LoadById(nPageID);

            switch (nCurentLanguage)
            {
                case 1:
                    lblTitleService.Text = ConvertData.ConvertToString(objStatic.Data.PageName1);
                    ltrContentServices.Text = ConvertData.ConvertToString(objStatic.Data.PageContent1);
                    break;
                case 2:
                    lblTitleService.Text = ConvertData.ConvertToString(objStatic.Data.PageName2);
                    ltrContentServices.Text = ConvertData.ConvertToString(objStatic.Data.PageContent2);
                    break;
                case 3:
                    lblTitleService.Text = ConvertData.ConvertToString(objStatic.Data.PageName3);
                    ltrContentServices.Text = ConvertData.ConvertToString(objStatic.Data.PageContent3);
                    break;
            }
           
        }
        catch
        {
            string sURL = Config.ROOT + Pages.FrontEnds.HOME;
            Response.Redirect(sURL);
        }
    }
}
    

